package _02datastructure
/*
范围
 */
def range = 1..10
//遍历
range.each {
    print it
}
for (i in range) {
    print i
}
println ''
//range结合switch
println getGrade(82)

def getGrade(Number number) {
    def result
    switch (number) {
        case 0..<60://表示[0-60)
            result = '不及格'
            break
        case 60..<70:
            result = '及格'
            break
        case 70..<80:
            result = '良好'
            break
        case 80..100:
            result = '优秀'
            break
    }

    return result
}